package com.yusvn.scm.common.routes;

import com.jfinal.config.Routes;
import com.yusvn.scm.admin.auth.AdminAuthInterceptor;
import com.yusvn.scm.admin.controller.AdminDictController;
import com.yusvn.scm.admin.controller.AdminDictDataController;
import com.yusvn.scm.admin.controller.AdminLoginRecordController;
import com.yusvn.scm.admin.controller.AdminMenuController;
import com.yusvn.scm.admin.controller.AdminRoleController;
import com.yusvn.scm.admin.controller.AdminUserController;
import com.yusvn.scm.admin.controller.LoginController;
import com.yusvn.scm.admin.controller.MainController;
import com.yusvn.scm.common.interceptor.LoginInterceptor;
import com.yusvn.scm.goods.base.controller.*;
import com.yusvn.scm.quartz.controller.ScmJobController;
import com.yusvn.scm.xsmx.controller.ScmXsmxController;

/**
 * 管理后台路由
 * @author liugz
 *
 */
public class AdminRoutes extends Routes {

	@Override
	public void config() {
		
		//登陆拦截器
		addInterceptor(new LoginInterceptor());
		//权限验证拦截器
		addInterceptor(new AdminAuthInterceptor());
		
		//登录
		add("/api", LoginController.class);
		add("/api/main", MainController.class);
		
		//后台管理模块
		add("/api/sys/user", AdminUserController.class);
		add("/api/sys/menu", AdminMenuController.class);
		add("/api/sys/role", AdminRoleController.class);
		add("/api/sys/dict", AdminDictController.class);
		add("/api/sys/dictdata", AdminDictDataController.class);
		add("/api/sys/loginRecord", AdminLoginRecordController.class);
		
		//定时任务
		add("/api/scm/job", ScmJobController.class); 
		add("/api/scm/joblog", ScmJobController.class); //任务日志，getJobLog()
		
		//业务基础模块
		add("/api/scm/base", ScmBaseController.class);
		
		add("/api/scm/base/pz", ScmPzController.class); 	 //主配置
		add("/api/scm/base/pzmx", ScmPzmxController.class);  //主配置明细

		
		
		//scm
		add("/api/scm/scm/xsmx", ScmXsmxController.class); //销售明细

		
	}

}
